#!/bin/bash
function print_usage {
cat << EOF
Usage: $0 (en|pt) | -c

en - English version
pt - Portuguese version
-c - Clean temporary files
EOF
}

if [ $# != 1 ]; then
  print_usage
  exit 1
fi
case "$1" in
  "-c")
    echo "Not implemented yet."
    exit 1
    ;;
  "en")
    pdflatex '\def \lang{en}\input{main.tex}'
    pdflatex '\def \lang{en}\input{main.tex}'
    ;;
  "pt")
    pdflatex '\def \lang{pt}\input{main.tex}'
    pdflatex '\def \lang{pt}\input{main.tex}'
    ;;
  *)
    echo "ERROR: Unknown option."
    exit 1
esac
